From: cl349@firebug.cl.cam.ac.uk Date: Mon, 8 May 2006 09:36:13 +0000 (+0100) Subject: Fix code which finds the default interface if there are static routes. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16108^2~5 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=3bd47fb5b68bb1bea57ffb26fdf8e3feaded9a44;p=xen.git Fix code which finds the default interface if there are static routes. The current code will break if there are multiple scope global routes since the "ip route list default" command doesn't use "default" as a filter, and will output multiple devices which breaks the rest of the script. Also make the vif/xenbr/eth naming consistent, i.e. if your default network interface is eth1, you get vif1 and xenbr1. Signed-off-by: Christian Limpach --- diff --git a/tools/examples/network-bridge b/tools/examples/network-bridge index 3c5b044701..377a32636e 100755 --- a/tools/examples/network-bridge +++ b/tools/examples/network-bridge @@ -59,9 +59,8 @@ dir=$(dirname "$0") findCommand "$@" evalVariables "$@" -vifnum=${vifnum:-0} +vifnum=${vifnum:-$(ip route list | awk '/^default / { sub(/eth/,"",$NF); print $NF }')} bridge=${bridge:-xenbr${vifnum}} -netdev=${netdev:-$(ip route list default scope global| awk '{ print $NF }')} netdev=${netdev:-eth${vifnum}} antispoof=${antispoof:-no}